package com.mengwen.backstage.mapper;

import com.mengwen.backstage.pojo.Anno;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author LiangYonghui
 * @date 2020/4/26 23:05
 * @description  管理员发送公告的数据访问层
 */
@Repository
@Mapper
public interface AnnoMapper {

    @Insert("INSERT INTO anno (unionid,openid,nickname,date,content) " +
            " VALUES(#{unionid},#{openid},#{nickname},#{date},#{content})")
    int sendAnno(Anno anno);


    @Delete("DELETE FROM anno")
    int deleteAnno();

    @Select("SELECT * FROM anno")
    Anno getAnno();
}
